# Contributor: Orhun Parmaksız <orhunparmaksiz@gmail.com>
# Maintainer: Orhun Parmaksız <orhunparmaksiz@gmail.com>
pkgname=tui-journal
_pkgname=tjournal
pkgver=0.6.1
pkgrel=0
pkgdesc="Write and manage journals/notes from the terminal"
url="https://github.com/AmmarAbouZor/tui-journal"
arch="all !s390x" # s390x: nix crate
license="MIT"
makedepends="
	cargo
	cargo-auditable
	openssl-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/AmmarAbouZor/tui-journal/archive/v$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$_pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

sha512sums="
411c029cdd27de4af215d22d3879fe8f981a8905dd6ca594ae093edd792756919d810db1bd92954105a4f86934db518c85f805657390826d142e67492db5b73b  tui-journal-0.6.1.tar.gz
"
